File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ public static function setHostedFieldsResource($hostedFieldsUrl){
121121 * @return void
122122 */
123123 public static function setHostedFieldsResourceRetrieve ($ hostedFieldsRetrieveUrl ){
124- self ::$ HOSTED_FIELDS_RESOURCE = $ hostedFieldsRetrieveUrl ;
124+ self ::$ HOSTED_FIELDS_RESOURCE_RETRIEVE = $ hostedFieldsRetrieveUrl ;
125125 }
126126
127127 /**
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ class HostedFieldTransactionResource
5252
5353 public function __construct ($ data = [])
5454 {
55+ // Accept raw JSON string
56+ if (is_string ($ data )) {
57+ $ decoded = json_decode ($ data , true );
58+ if (json_last_error () === JSON_ERROR_NONE ) {
59+ $ data = $ decoded ;
60+ }
61+ }
5562 if (empty ($ data ) || !is_array ($ data )) {
5663 return ;
5764 }
@@ -63,10 +70,11 @@ public function __construct($data = [])
6370 $ this ->currency = !empty ($ payment_data ['CURRENCY ' ]) ? $ payment_data ['CURRENCY ' ] : 'EUR ' ;
6471 $ this ->created_at = !empty ($ payment_data ['DATE ' ]) ? $ payment_data ['DATE ' ] : null ;
6572 $ this ->description = !empty ($ payment_data ['DESCRIPTION ' ]) ? $ payment_data ['DESCRIPTION ' ] : '' ;
66- $ this ->is_paid = ! empty ( $ payment_data [ ' DATE ' ]) ? $ payment_data [ ' DATE ' ] : false ;
73+ $ this ->is_paid = $ data [ ' EXECCODE ' ]== ' 0000 ' ;
6774 $ this ->paid_at = !empty ($ payment_data ['DATE ' ]) ? $ payment_data ['DATE ' ] : null ;
6875 $ this ->is_3ds = !empty ($ payment_data ['3DSECURE ' ]) ? $ payment_data ['3DSECURE ' ] : false ;
6976 $ this ->card = [
77+ 'id ' => null ,
7078 'last4 ' => null ,
7179 'exp_month ' => null ,
7280 'exp_year ' => null ,
You can’t perform that action at this time.
0 commit comments