pronamic / wp-pronamic-pay

The Pronamic Pay plugin allows you to easily accept payments with payment methods like credit card, iDEAL, Bancontact and Sofort through a variety of payment providers on your WordPress website.
https://pronamicpay.com
35 stars 14 forks source link

Store `_pronamic_payment_config_id` in JSON #231

Closed remcotolsma closed 3 years ago

remcotolsma commented 3 years ago

In https://github.com/pronamic/wp-pronamic-pay/issues/196 i suggested to store more gateway configuration within each payment / subscription. Maybe we can already take this into account within this issue?

payment {
    "config_id": "50"
}
payment {
    "gateway_configuration": {
        "$ref": "http://pay.local/wp-json/pronamic-pay/v1/gateways/configurations/50",
        "post_id": "50"  
    }
}

@rvdsteege ?

remcotolsma commented 3 years ago

In many places we use config_id like this: $gateway = Plugin::get_gateway( $payment->get_config_id() );. We could also consider to change it to $gateway = $payment->get_gateway():

payment {
    "gateway": {
        "$ref": "http://pay.local/wp-json/pronamic-pay/v1/gateways/50",
        "post_id": "50"  
    }
}
remcotolsma commented 3 years ago

Fixed in: